Before your application can read data using a data handler component, you must open a read path to the current data reference. Use the DataHOpenForRead function to request read access to the current data reference. Once you have gained read access to the data reference, data handlers provide both high- and low-level read functions.
The high-level function, DataHGetData , provides an easy-to-use, synchronous read interface. Being a synchronous function, DataHGetData does not return control to your application until the data handler has read and delivered the data you request.
If you need more control over the read operation, you can use the low-level function, DataHScheduleData , to issue asynchronous read requests. When you call this function, you provide detailed information specifying when you need the data from the request. The data handler returns control to your application immediately, and then processes the request when appropriate. When the data handler completes the request, it calls your data-handler completion function to report that the request has been satisfied, see "Completion Function" for more information on the data-handler completion function.
Besides simply scheduling read requests that must be satisfied during a movie's playback, another use of the DataHScheduleData function is to prepare a movie for playback (commonly referred to as pre-rolling the movie). The DataHScheduleData function uses several special values to indicate a pre-roll operation. Your application calls the DataHScheduleData function one or more times to schedule the pre-roll read requests, and then uses the DataHFinishData function to tell the data handler to start delivering the requested data.
For more information on these functions and about pre-roll operations, see "Reading Movie Data" .
| Previous | Chapter Contents | Chapter Top | Next |